/*
   @Copyright:LeetCode
   @Author:   tjyemail
   @Problem:  http://leetcode.com/problems/single-number
   @Language: C++
   @Datetime: 19-11-18 14:03
   */

class Solution {
public:
	int singleNumber(vector<int>& nums) {
		int num=nums[0];
		for(int i=nums.size(); --i; num = num^nums[i]);
		return num;
	}
};
